package mysql

import "gorm.io/gorm"

type Doctor struct {
	gorm.Model
	DoctorCode     string `gorm:"type:varchar(30)"`
	DoctorPassword string `gorm:"type:varchar(32)"`
}

func (d *Doctor) FindDocByCode(db *gorm.DB, code string) error {
	return db.Debug().Where("doctor_code=?", code).First(d).Error
}

func (d *Doctor) FindDocById(db *gorm.DB, id int64) error {
	return db.Debug().Where("doctors.id=?", id).Find(d).Error
}
